package com.sinosoft.tcmemr.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sinosoft.tcmemr.entity.PcaseModelEntity;
import com.sinosoft.tcmemr.manager.PcaseModelManager;

@Service
public class PcaseModelService {
	@Autowired
	private PcaseModelManager pcasemodelmanager;
	
	/**
	 * 查询病历模板
	 * @param type 类型
	 * @param modelName模板名称
	 * @return PcaseModelEntity
	 */
	public PcaseModelEntity getByModelName(int type,String modelName){
		return pcasemodelmanager.selectByModelName(type, modelName);
	}
	/**
	 * 插入模板
	 * @param pcasemodel
	 * @return true/false
	 */
	public boolean addPcaseModel(PcaseModelEntity pcasemodel){
		return pcasemodelmanager.insertSelective(pcasemodel);
	}
	/**
	 * 更新模板
	 * @param pcasemodel
	 * @return true/false
	 */
	public boolean updateByPrimaryKeySelective(PcaseModelEntity pcasemodel){
		return pcasemodelmanager.updateByPrimaryKeySelective(pcasemodel);
	}
	
	/**
	 * 删除模板
	 * @param id模版ID
	 * @return true/false
	 */
	public boolean deleteByPrimaryKey(Integer id){
		return pcasemodelmanager.deleteByPrimaryKey(id);
	}
	
	
}
